package com.guigu.qingcheng.orderservice.service;

import com.guigu.qingcheng.pojo.goods.TbSku;
import com.guigu.qingcheng.pojo.order.TbOrderItem;
import com.guigu.qingcheng.utils.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@Component
@FeignClient("service-goods")
public interface GoodsFeign {

    @GetMapping("/goods/sku/findByIds")
    public TbSku findBySkuByOrder(@RequestParam("id") String id);

    @PostMapping("/goods/sku/update")
    public R updateSkuByOrder(@RequestBody  TbSku tbSku);


    @PostMapping("/goods/sku/deductionStock")
    public boolean deductionStock(@RequestBody(required = true) List<TbOrderItem> oderItemList);

}
